package net.nagaseyasuhito.kinsenka.wicket.component;

import org.apache.wicket.model.IModel;
import org.apache.wicket.validation.validator.PatternValidator;

public class IdentifierField extends NameField {
	public static final String IDENTIFIER_PATTERN = "\\p{Alnum}*";

	private static final long serialVersionUID = 1L;

	public IdentifierField(String id) {
		this(id, null);
	}

	public IdentifierField(String id, IModel<CharSequence> model) {
		super(id, model);

		this.add(new PatternValidator(IdentifierField.IDENTIFIER_PATTERN));
	}
}
